/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package control;

import java.io.IOException;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import model.ConvenioDAO;

/**
 *
 * @author Eduarda
 */
public class TrataPreCadastraPaciente extends Comando{

    @Override
    public void executar(HttpServletRequest request, HttpServletResponse response) throws ClassNotFoundException, SQLException, IOException, ServletException {
        
         response.setContentType("text/html;charset=UTF-8");

        ConvenioDAO con = new ConvenioDAO();
        
        HttpSession session = request.getSession(false);
        session.setAttribute("listaConvenios", con.pesquisar());
       //session.setAttribute("listaPacientes", new ArrayList());        
        response.sendRedirect("cadastraPaciente.jsp");
    }
    
}
